#include <stdio.h>
#include <assert.h>
char* my_strncpy(char* dest, const char* src, size_t num)
{
	assert(dest && src);
	char* ret = dest;
	while (*src && num--)
	{
		*dest++ = *src++;
	}
	while (num--)
	{
		*dest = '\0';
	}
	return ret;
}
int main()
{
	char arr1[] = "Hello World";
	char arr2[20] = "\0";
	printf("%s\n", my_strncpy(arr2, arr1, 11));
	return 0;
}